package GraphicArea;

public class AreaCalculation {
    public static void main(String[] args) {
        Shape[] shapes = {
                new Circle(5.0),
                new Triangle(6.0, 3.0),
                new Rectangle(3.0, 6.0)
        };

        //多态性
        for (Shape shape : shapes) {
            System.out.println(shape + " 的面积是: " + String.format("%.2f",shape.getArea()));
        }
    }
}
